import os

import cv2

images = []

for folder in os.scandir("images/3"):
    if folder.is_dir():
        image_item = []
        for image in os.scandir(folder):
            i = cv2.imread(image.path)
            cv2.resize(i, (0, 0), None, 0.2, 0.2)
            image_item.append(i)
        images.append(image_item)

for image_list in images:
    stitcher = cv2.Stitcher.create()
    (status, result) = stitcher.stitch(image_list)
    if status == cv2.STITCHER_OK:
        cv2.imshow('Image', result)
        cv2.waitKey(0)
